var addComment={moveForm:function(a,b,c,d){var e,f,g,h,i=this,j=i.I(a),k=i.I(c),l=i.I("cancel-comment-reply-link"),m=i.I("comment_parent"),n=i.I("comment_post_ID"),o=k.getElementsByTagName("form")[0];if(j&&k&&l&&m&&o){i.respondId=c,d=d||!1,i.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",k.parentNode.insertBefore(e,k)),j.parentNode.insertBefore(k,j.nextSibling),n&&d&&(n.value=d),m.value=b,l.style.display="",l.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{for(var p=0;p").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;i').val(m.extraData[d].value).appendTo(w)[0]:e('').val(m.extraData[d]).appendTo(w)[0]);m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(h){var x=document.createElement("form").submit;x.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",c),r?w.setAttribute("target",r):f.removeAttr("target"),e(l).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t==k&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(m.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(l){var p=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];p?x.responseText=p.textContent?p.textContent:p.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==c&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,c,m)}catch(y){i="parsererror",x.error=r=y||i}}catch(y){a("error caught: ",y),i="error",x.error=r=y||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,m,r])),d&&e.event.trigger("ajaxComplete",[x,m]),d&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var c,l,m,d,p,v,g,x,y,b,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;l'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand ("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),d&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},d=m.global,d&&0===e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;y=w.clk,y&&(b=y.name,b&&!y.disabled&&(m.extraData=m.extraData||{},m.extraData[b]=y.value,"image"==y.type&&(m.extraData[b+".x"]=w.clk_x,m.extraData[b+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,c,l,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),c=t.url||this.attr2("action"),l="string"==typeof c?e.trim(c):"",l=l||window.location.href||"",l&&(l=(l.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:l,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var d=t.traditional;void 0===d&&(d=e.ajaxSettings.traditional);var p,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,p=e.param(t.data,d)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,d);p&&(g=g?g+"&"+p:p),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var y=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(y,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var b=t.error;t.error=function(e,r,a){var n=t.context||this;b.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;Ec;c++)if(d=u[c],f=d.name,f&&!d.disabled)if(t&&o.clk&&"image"==d.type)o.clk==d&&(a.push({name:f,value:e(d).val(),type:d.type}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}));else if(m=e.fieldValue(d,!0),m&&m.constructor==Array)for(r&&r.push(d),l=0,h=m.length;h>l;l++)a.push({name:f,value:m[l]});else if(n.fileapi&&"file"==d.type){r&&r.push(d);var v=d.files;if(v.length)for(l=0;li;i++)r.push({name:a,value:n[i]});else null!==n&&"undefined"!=typeof n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||"undefined"==typeof o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,c="select-one"==n,l=c?o+1:u.length,f=c?o:0;l>f;f++){var m=u[f];if(m.selected){var d=m.value;if(d||(d=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),c)return d;s.push(d)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1}); (function($){ 'use strict'; if(typeof _wpcf7=='undefined'||_wpcf7===null){ _wpcf7={};} _wpcf7=$.extend({ cached: 0 }, _wpcf7); $.fn.wpcf7InitForm=function(){ this.ajaxForm({ beforeSubmit: function(arr, $form, options){ $form.wpcf7ClearResponseOutput(); $form.find('[aria-invalid]').attr('aria-invalid', 'false'); $form.find('img.ajax-loader').css({ visibility: 'visible' }); return true; }, beforeSerialize: function($form, options){ $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val(''); }); return true; }, data: { '_wpcf7_is_ajax_call': 1 }, dataType: 'json', success: $.wpcf7AjaxSuccess, error: function(xhr, status, error, $form){ var e=$('
').text(error.message); $form.after(e); }}); if(_wpcf7.cached){ this.wpcf7OnloadRefill(); } this.wpcf7ToggleSubmit(); this.find('.wpcf7-submit').wpcf7AjaxLoader(); this.find('.wpcf7-acceptance').click(function(){ $(this).closest('form').wpcf7ToggleSubmit(); }); this.find('.wpcf7-exclusive-checkbox').wpcf7ExclusiveCheckbox(); this.find('.wpcf7-list-item.has-free-text').wpcf7ToggleCheckboxFreetext(); this.find('[placeholder]').wpcf7Placeholder(); if(_wpcf7.jqueryUi&&! _wpcf7.supportHtml5.date){ this.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(_wpcf7.jqueryUi&&! _wpcf7.supportHtml5.number){ this.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } this.find('.wpcf7-character-count').wpcf7CharacterCount(); this.find('.wpcf7-validates-as-url').change(function(){ $(this).wpcf7NormalizeUrl(); }); this.find('.wpcf7-recaptcha').wpcf7Recaptcha(); }; $.wpcf7AjaxSuccess=function(data, status, xhr, $form){ if(! $.isPlainObject(data)||$.isEmptyObject(data)){ return; } var $responseOutput=$form.find('div.wpcf7-response-output'); $form.wpcf7ClearResponseOutput(); $form.find('.wpcf7-form-control').removeClass('wpcf7-not-valid'); $form.removeClass('invalid spam sent failed'); if(data.captcha){ $form.wpcf7RefillCaptcha(data.captcha); } if(data.quiz){ $form.wpcf7RefillQuiz(data.quiz); } if(data.invalids){ $.each(data.invalids, function(i, n){ $form.find(n.into).wpcf7NotValidTip(n.message); $form.find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid'); $form.find(n.into).find('[aria-invalid]').attr('aria-invalid', 'true'); }); $responseOutput.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); $(data.into).trigger('wpcf7:invalid'); $(data.into).trigger('invalid.wpcf7'); }else if(1==data.spam){ $form.find('[name="g-recaptcha-response"]').each(function(){ if(''==$(this).val()){ var $recaptcha=$(this).closest('.wpcf7-form-control-wrap'); $recaptcha.wpcf7NotValidTip(_wpcf7.recaptcha.messages.empty); }}); $responseOutput.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); $(data.into).trigger('wpcf7:spam'); $(data.into).trigger('spam.wpcf7'); }else if(1==data.mailSent){ $responseOutput.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); if(data.onSentOk){ $.each(data.onSentOk, function(i, n){ eval(n) }); } $(data.into).trigger('wpcf7:mailsent'); $(data.into).trigger('mailsent.wpcf7'); }else{ $responseOutput.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); $(data.into).trigger('wpcf7:mailfailed'); $(data.into).trigger('mailfailed.wpcf7'); } if(data.onSubmit){ $.each(data.onSubmit, function(i, n){ eval(n) }); } $(data.into).trigger('wpcf7:submit'); $(data.into).trigger('submit.wpcf7'); if(1==data.mailSent){ $form.resetForm(); } $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); $responseOutput.append(data.message).slideDown('fast'); $responseOutput.attr('role', 'alert'); $.wpcf7UpdateScreenReaderResponse($form, data); }; $.fn.wpcf7ExclusiveCheckbox=function(){ return this.find('input:checkbox').click(function(){ var name=$(this).attr('name'); $(this).closest('form').find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); }; $.fn.wpcf7Placeholder=function(){ if(_wpcf7.supportHtml5.placeholder){ return this; } return this.each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')) $(this).val('').removeClass('placeheld'); }); $(this).blur(function(){ if(''==$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); }; $.fn.wpcf7AjaxLoader=function(){ return this.each(function(){ var loader=$('') .attr({ src: _wpcf7.loaderUrl, alt: _wpcf7.sending }) .css('visibility', 'hidden'); $(this).after(loader); }); }; $.fn.wpcf7ToggleSubmit=function(){ return this.each(function(){ var form=$(this); if(this.tagName.toLowerCase()!='form'){ form=$(this).find('form').first(); } if(form.hasClass('wpcf7-acceptance-as-validation')){ return; } var submit=form.find('input:submit'); if(! submit.length) return; var acceptances=form.find('input:checkbox.wpcf7-acceptance'); if(! acceptances.length) return; submit.removeAttr('disabled'); acceptances.each(function(i, n){ n=$(n); if(n.hasClass('wpcf7-invert')&&n.is(':checked') || ! n.hasClass('wpcf7-invert')&&! n.is(':checked')){ submit.attr('disabled', 'disabled'); }}); }); }; $.fn.wpcf7ToggleCheckboxFreetext=function(){ return this.each(function(){ var $wrap=$(this).closest('.wpcf7-form-control'); if($(this).find(':checkbox, :radio').is(':checked')){ $(this).find(':input.wpcf7-free-text').prop('disabled', false); }else{ $(this).find(':input.wpcf7-free-text').prop('disabled', true); } $wrap.find(':checkbox, :radio').change(function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); var $freetext=$(':input.wpcf7-free-text', $wrap); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); }; $.fn.wpcf7CharacterCount=function(){ return this.each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function($target){ var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $count.closest('form').find(':input[name="' + name + '"]').each(function(){ updateCount($(this)); $(this).keyup(function(){ updateCount($(this)); }); }); }); }; $.fn.wpcf7NormalizeUrl=function(){ return this.each(function(){ var val=$.trim($(this).val()); if(val&&! val.match(/^[a-z][a-z0-9.+-]*:/i)){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; $.fn.wpcf7NotValidTip=function(message){ return this.each(function(){ var $into=$(this); $into.find('span.wpcf7-not-valid-tip').remove(); $into.append('' + message + ''); if($into.is('.use-floating-validation-tip *')){ $('.wpcf7-not-valid-tip', $into).mouseover(function(){ $(this).wpcf7FadeOut(); }); $(':input', $into).focus(function(){ $('.wpcf7-not-valid-tip', $into).not(':hidden').wpcf7FadeOut(); }); }}); }; $.fn.wpcf7FadeOut=function(){ return this.each(function(){ $(this).animate({ opacity: 0 }, 'fast', function(){ $(this).css({'z-index': -100}); }); }); }; $.fn.wpcf7OnloadRefill=function(){ return this.each(function(){ var url=$(this).attr('action'); if(0 < url.indexOf('#')){ url=url.substr(0, url.indexOf('#')); } var id=$(this).find('input[name="_wpcf7"]').val(); var unitTag=$(this).find('input[name="_wpcf7_unit_tag"]').val(); $.getJSON(url, { _wpcf7_is_ajax_call: 1, _wpcf7: id, _wpcf7_request_ver: $.now() }, function(data){ if(data&&data.captcha){ $('#' + unitTag).wpcf7RefillCaptcha(data.captcha); } if(data&&data.quiz){ $('#' + unitTag).wpcf7RefillQuiz(data.quiz); }} ); }); }; $.fn.wpcf7RefillCaptcha=function(captcha){ return this.each(function(){ var form=$(this); $.each(captcha, function(i, n){ form.find(':input[name="' + i + '"]').clearFields(); form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]); }); }); }; $.fn.wpcf7RefillQuiz=function(quiz){ return this.each(function(){ var form=$(this); $.each(quiz, function(i, n){ form.find(':input[name="' + i + '"]').clearFields(); form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]); }); }); }; $.fn.wpcf7ClearResponseOutput=function(){ return this.each(function(){ $(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked').removeAttr('role'); $(this).find('span.wpcf7-not-valid-tip').remove(); $(this).find('img.ajax-loader').css({ visibility: 'hidden' }); }); }; $.fn.wpcf7Recaptcha=function(){ return this.each(function(){ var events='wpcf7:spam wpcf7:mailsent wpcf7:mailfailed'; $(this).closest('div.wpcf7').on(events, function(e){ if(recaptchaWidgets&&grecaptcha){ $.each(recaptchaWidgets, function(index, value){ grecaptcha.reset(value); }); }}); }); }; $.wpcf7UpdateScreenReaderResponse=function($form, data){ $('.wpcf7 .screen-reader-response').html('').attr('role', ''); if(data.message){ var $response=$form.siblings('.screen-reader-response').first(); $response.append(data.message); if(data.invalids){ var $invalids=$('
    '); $.each(data.invalids, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }}; $.wpcf7SupportHtml5=function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value){ input.setAttribute('type', value); features[value]=input.type!=='text'; }); return features; }; $(function(){ _wpcf7.supportHtml5=$.wpcf7SupportHtml5(); $('div.wpcf7 > form').wpcf7InitForm(); }); })(jQuery); !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(t){function e(t){return t.replace(/(:|\.|\/)/g,"\\$1")}var o="1.6.0",i={},l={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},s=function(e){var o=[],i=!1,l=e.dir&&"left"===e.dir?"scrollLeft":"scrollTop";return this.each(function(){var e=t(this);return this!==document&&this!==window?!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(e[l]()>0?o.push(this):(e[l](1),i=e[l]()>0,i&&o.push(this),e[l](0))):(o.push(document.scrollingElement),!1):void 0}),o.length||this.each(function(){"BODY"===this.nodeName&&(o=[this])}),"first"===e.el&&o.length>1&&(o=[o[0]]),o};t.fn.extend({scrollable:function(t){var e=s.call(this,{dir:t});return this.pushStack(e)},firstScrollable:function(t){var e=s.call(this,{el:"first",dir:t});return this.pushStack(e)},smoothScroll:function(o,i){if(o=o||{},"options"===o)return i?this.each(function(){var e=t(this),o=t.extend(e.data("ssOpts")||{},i);t(this).data("ssOpts",o)}):this.first().data("ssOpts");var l=t.extend({},t.fn.smoothScroll.defaults,o),s=function(o){var i=this,s=t(this),n=t.extend({},l,s.data("ssOpts")||{}),c=l.exclude,a=n.excludeWithin,r=0,h=0,u=!0,d={},p=t.smoothScroll.filterPath(location.pathname),f=t.smoothScroll.filterPath(i.pathname),m=location.hostname===i.hostname||!i.hostname,g=n.scrollTarget||f===p,v=e(i.hash);if(n.scrollTarget||m&&g&&v){for(;u&&r1&&"[object Object]"!==String(e)){if(o=jQuery.extend({},o),(null===e||void 0===e)&&(o.expires=-1),"number"==typeof o.expires){var i=o.expires,l=o.expires=new Date;l.setDate(l.getDate()+i)}return e=String(e),document.cookie=[encodeURIComponent(t),"=",o.raw?e:encodeURIComponent(e),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}o=e||{};var s,n=o.raw?function(t){return t}:decodeURIComponent;return(s=new RegExp("(?:^|;)"+encodeURIComponent(t)+"=([^;]*)").exec(document.cookie))?n(s[1]):null},jQuery(document).ready(function(t){if("undefined"!=typeof tocplus){if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},1==tocplus.smooth_scroll){var e=hostname=pathname=qs=hash=null;t("body a").click(function(){if(hostname=t(this).prop("hostname"),pathname=t(this).prop("pathname"),qs=t(this).prop("search"),hash=t(this).prop("hash"),pathname.length>0&&"/"!=pathname.charAt(0)&&(pathname="/"+pathname),window.location.hostname==hostname&&window.location.pathname==pathname&&window.location.search==qs&&""!==hash){var o=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,"\\$1");t(o).length>0?e=hash:(anchor=hash,anchor=anchor.replace("#",""),e='a[name="'+anchor+'"]',0==t(e).length&&(e="")),offset="undefined"!=typeof tocplus.smooth_scroll_offset?-1*tocplus.smooth_scroll_offset:t("#wpadminbar").length>0&&t("#wpadminbar").is(":visible")?-30:0,e&&t.smoothScroll({scrollTarget:e,offset:offset})}})}if("undefined"!=typeof tocplus.visibility_show){var o="undefined"!=typeof tocplus.visibility_hide_by_default?!0:!1;if(t.cookie)var i=t.cookie("tocplus_hidetoc")?tocplus.visibility_show:tocplus.visibility_hide;else var i=tocplus.visibility_hide;o&&(i=i==tocplus.visibility_hide?tocplus.visibility_show:tocplus.visibility_hide),t("#toc_container p.toc_title").append(' ['+i+"]"),i==tocplus.visibility_show&&(t("ul.toc_list").hide(),t("#toc_container").addClass("contracted").shrinkTOCWidth()),t("span.toc_toggle a").click(function(e){switch(e.preventDefault(),t(this).html()){case t("
    ").html(tocplus.visibility_hide).text():t(this).html(tocplus.visibility_show),t.cookie&&(o?t.cookie("tocplus_hidetoc",null,{path:"/"}):t.cookie("tocplus_hidetoc","1",{expires:30,path:"/"})),t("ul.toc_list").hide("fast"),t("#toc_container").addClass("contracted").shrinkTOCWidth();break;case t("
    ").html(tocplus.visibility_show).text():default:t(this).html(tocplus.visibility_hide),t.cookie&&(o?t.cookie("tocplus_hidetoc","1",{expires:30,path:"/"}):t.cookie("tocplus_hidetoc",null,{path:"/"})),t("#toc_container").css("width",tocplus.width).removeClass("contracted"),t("ul.toc_list").show("fast")}})}}}); ;(function(e){function b(){c=a.filter(function(){var f=e(this),a=d.scrollTop(),b=a+d.height(),c=f.offset().top;return c+f.height()>=a-g&&c<=b+g});a=a.not(c.trigger("scrollin"))}var d=e(window),g=200,a=e("img[data-src]"),c;a.bind("scrollin",{},function(){var a=jQuery(this),b=a.attr("data-src");a.unbind("scrollin").hide().removeAttr("data-src");this.src=b;a.fadeIn()});d.scroll(b);d.resize(b);b();return this})(jQuery); !function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(200>~~g)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document); jQuery(function(){jQuery(".tsa_param_field_tsa_2 input#tsa_param_field_tsa_3").val(jQuery(".tsa_param_field_tsa_ input").val());var a=new Date();var b=null;if(typeof a.toISOString!="undefined"){b=a.toISOString().match(/(\d{4}\-\d{2}\-\d{2})T(\d{2}:\d{2}:\d{2})/);current_date=b[1]+" "+b[2];if(jQuery("#comments form input#tsa_param_field_tsa_3").length==0){jQuery("#comments form").append('')}if(jQuery("#respond form input#tsa_param_field_tsa_3").length==0){jQuery("#respond form").append('')}if(jQuery("form#commentform input#tsa_param_field_tsa_3").length==0){jQuery("form#commentform").append('')}}}); new function(){var a="footer";var c="fixed-footer";function b(){var h=document.getElementsByTagName("body")[0].clientHeight;document.getElementById(a).style.top="0px";var i=document.getElementById(a).offsetTop;var f=document.getElementById(a).offsetHeight;if(window.innerHeight){var g=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight!=0){var g=document.documentElement.clientHeight}}if(i+f400){a.fadeIn()}else{a.fadeOut()}});a.click(function(){jQuery("body,html").animate({scrollTop:0},800);return false})});(function(c,j,h){function d(){return j("body").hasClass("mobile")}var i={click:function(k){k.preventDefault();k.stopPropagation();if(!d()||this.isClickable()){c.location.replace(this.getLink().attr("href"));return}this.toggle()},mouseenter:function(){this.expand ()},mouseleave:function(){this.collapse()}};var e=(function(){function m(A,x,y,z){if(!(this instanceof m)){return new m(A)}x=x||{click:function(){},mouseenter:function(){},mouseleave:function(){}};this.$element=A;this.expanded=(typeof y!=="undefined")?y:false;this.$icon=null;this.listener=x;this.mobile=(typeof z!=="undefined")?z:true}m.prototype.getElement=function q(){return this.$element};m.prototype.getIcon=function t(){this.$icon=this.$icon||j("").prependTo(this.$element);return this.$icon};m.prototype.getLink=function s(){return this.$element.find("> a").eq(0)};m.prototype.hasChildren=function w(){return !!this.$element.find("> ul").length};m.prototype.isExpanded=function o(){return this.expanded};m.prototype.isClickable=function u(){if(!this.getLink().length){return false}return(!this.hasChildren()||(this.hasChildren()&&this.isExpanded()))};m.prototype.initialize=function p(){this.$icon=j("");this.$element.prepend(this.$icon);this.refresh(false);this.addEventListener()};m.prototype.refresh=function l(x){x=(typeof x!=="undefined")?x:true;if(this.expanded||!this.hasChildren()){this.expand (x)}else{this.collapse(x)}};m.prototype.expand=function n(y){var x=this;this.expanded=true;y=(typeof y!=="undefined")?y:true;if(y){this.$element.find("> ul").slideDown("fast",function(){x.getIcon().attr({"class":"fa fa-angle-right"});x.$element.removeClass("menu-item-collapsed").addClass("menu-item-expanded")})}else{this.getIcon().attr({"class":"fa fa-angle-right"});this.$element.removeClass("menu-item-collapsed").addClass("menu-item-expanded")}};m.prototype.collapse=function k(y){var x=this;this.expanded=false;y=(typeof y!=="undefined")?y:true;if(y){this.$element.find("> ul").slideUp("fast",function(){x.getIcon().attr({"class":"fa fa-angle-down"});x.$element.removeClass("menu-item-expanded").addClass("menu-item-collapsed")})}else{this.getIcon().attr({"class":"fa fa-angle-down"});this.$element.removeClass("menu-item-expanded").addClass("menu-item-collapsed")}};m.prototype.toggle=function v(){if(!this.hasChildren()){return}this.expanded?this.collapse():this.expand ()};m.prototype.addEventListener=function r(){this.$element.click(j.proxy(this.listener.click,this));if(!this.mobile){this.$element.hover(j.proxy(this.listener.mouseenter,this),j.proxy(this.listener.mouseleave,this))}};return m}());var a=(function(){function k(p,q){if(!(this instanceof k)){return new k()}this.$element=p;this.mobile=(typeof q!=="undefined")?q:true}k.prototype.initialize=function n(){var p=this;this.getMenuItems().each(function(){var r=j(this);var q=new e(r,i,false,p.mobile);r.data("st-menu",p);r.data("st-menu-item",q);q.initialize()});this.addEventListener()};k.prototype.getMenuItems=function o(){return this.$element.find("li")};k.prototype.collapseChildren=function m(){this.getMenuItems().each(function(){j(this).data("st-menu-item").collapse()})};k.prototype.addEventListener=function l(){var p=this;if(this.mobile){return}this.$element.on("mouseleave",function(){p.collapseChildren()})};return k}());function g(){var l=j(".acordion_tree ul.menu");var k=d();l.each(function(){var m=j(this);var n=new a(m,k);m.data("st-menu",n);n.initialize()})}function f(){var k=j(".trigger");k.click(function(l){var m=j(this);l.preventDefault();l.stopPropagation();m.toggleClass("active");m.next(".acordion_tree").slideToggle("normal")})}function b(){g();f()}j(b)}(window,jQuery));jQuery(function(){jQuery("ul.menu li").filter(function(){return !jQuery(this).closest(".acordion").length}).hover(function(){jQuery(">ul:not(:animated)",this).slideDown("fast")},function(){jQuery(">ul",this).slideUp("fast")})});(function(b,a,c,d){if(typeof c.fn.slick==="undefined"){return}c(function(){c("[data-slick]").slick()})}(window,window.document,jQuery));jQuery("p.copy").append('');jQuery(function(){jQuery("span.hatenamark").each(function(){jQuery(this).prepend('')});jQuery("span.checkmark").each(function(){jQuery(this).prepend('')});jQuery("span.attentionmark").each(function(){jQuery(this).prepend('')});jQuery("span.memomark").each(function(){jQuery(this).prepend('')})});jQuery(function(){var a=jQuery("#mobile-top");a.hide();jQuery(window).scroll(function(){if(jQuery(this).scrollTop()>400){a.fadeIn()}else{a.fadeOut()}});a.click(function(){jQuery('body,html').animate({scrollTop:0},800);return false;});}); if(window.matchMedia('(max-width:781px)').matches){ }else{ ;(function ($){ 'use strict'; $(function (){ var $main=$('main'); var $side=$('#side aside'); var $wrapper=$('#scrollad'); if($main.length===0||$side.length===0||$wrapper.length===0){ return; } var $window=$(window); var wrapperHeight=$wrapper.outerHeight(); var wrapperTop=$wrapper.offset().top; var sideLeft=$side.offset().left; var sideMargin={ top: $side.css('margin-top') ? $side.css('margin-top'):0, right: $side.css('margin-right') ? $side.css('margin-right'):0, bottom: $side.css('margin-bottom') ? $side.css('margin-bottom'):0, left: $side.css('margin-left') ? $side.css('margin-left'):0 }; var winLeft; var pos; var scrollAdjust=function (){ var sideHeight=$side.outerHeight(); var mainHeight=$main.outerHeight(); var mainAbs=$main.offset().top + mainHeight; var winTop=$window.scrollTop(); var winHeight=$window.height(); var nf=(winTop > wrapperTop)&&(mainHeight > sideHeight) ? true:false; winLeft=$window.scrollLeft(); pos = !nf ? 'static':(winTop + wrapperHeight) > mainAbs ? 'absolute':'fixed'; if(pos==='fixed'){ $side.css({ position: pos, top: '', bottom: winHeight - wrapperHeight, left: sideLeft - winLeft, margin: 0 }); }else if(pos==='absolute'){ $side.css({ position: pos, top: mainAbs - sideHeight, bottom: '', left: sideLeft, margin: 0 }); }else{ $side.css({ position: pos, marginTop: sideMargin.top, marginRight: sideMargin.right, marginBottom: sideMargin.bottom, marginLeft: sideMargin.left }); }}; var resizeAdjust=function (){ $side.css({ position: 'static', marginTop: sideMargin.top, marginRight: sideMargin.right, marginBottom: sideMargin.bottom, marginLeft: sideMargin.left }); sideLeft=$side.offset().left; winLeft=$window.scrollLeft(); if(pos==='fixed'){ $side.css({ position: pos, left: sideLeft - winLeft, margin: 0 }); }else if(pos==='absolute'){ $side.css({ position: pos, left: sideLeft, margin: 0 }); }}; scrollAdjust(); $window.on('scroll', scrollAdjust); $window.on('resize', function (){ scrollAdjust(); resizeAdjust(); }); }); })(jQuery); }; (function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},i=0,c=0,l=[];function g(g,d,h,e){var c={data:e||(e===0||e===false)?e:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};g&&a.extend(c,g,{nodes:[],parent:d});if(h){c.tmpl=h;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++i;(l.length?f:b)[i]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h0?this.clone(true):this).get();a(i[h])[d](k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,m,k){if(d[0]&&a.isArray(d[0])){var g=a.makeArray(arguments),h=d[0],j=h.length,i=0,f;while(i").join(">").split('"').join(""").split("'").join("'")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1)&&$1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1)&&$1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function j(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:j(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=k(c).concat(b);if(d)b=b.concat(k(d))});return b?b:k(c)}function k(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{=$1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,k,g,b,c,d){var j=a.tmpl.tag[k],i,e,f;if(!j)throw"Unknown template tag: "+k;i=j._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=h(b);d=d?","+h(d)+")":c?")":"";e=c?b.indexOf(".")>-1?b+h(c):"("+b+").call($item"+d:b;f=c?e:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else f=e=i.$1||"null";g=h(g);return"');"+j[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined'&&("+b+")!=null":"true").split("$1a").join(f).split("$1").join(e).split("$2").join(g||i.$2||"")+"__.push('"})+"');}return __;")}function n(c,b){c._wrap=j(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function h(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,h;for(e=0,p=o.length;e=0;h--)m(j[h]);m(k)}function m(j){var p,h=j,k,e,m;if(m=j.getAttribute(d)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(p=h.getAttribute(d)));if(p!==m){h=h.parentNode?h.nodeType===11?0:h.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[h]||f[h]);e.key=++i;b[i]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;h=a.data(j.parentNode,"tmplItem");h=h?h.key:0}if(e){k=e;while(k&&k.key!=h){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery); (function ($){ if(!$) return; var ua=navigator.userAgent, isIE=ua.match(/msie/i), isIE6=isIE&&ua.match(/msie 6\./i), location=window.location, isHttpsScheme=location&&location.protocol&&location.protocol=='https:'; $.extend({ amazonjs:{ imageAttributes: ['SmallImage', 'MediumImage', 'LargeImage'], isCustomerReviewEnabled: false, isTrackEventEnabled: false, resource: {}, initTemplate:function (){ var r=this.resource; var linkOpenTag=''; var smallImageTemplate = [ '{{if SmallImage}}', '{{if $item.setInfoMargin(SmallImage.width+10)}}{{/if}}', '', '{{/if}}' ].join(''); var mediumImageTemplate = [ '{{if MediumImage}}', '{{if $item.setInfoMargin(MediumImage.width+10)}}{{/if}}', '
    ', linkOpenTag, '${Title}', '', '
    ', '{{/if}}' ].join(''); var largeImageTemplate = [ '{{if LargeImage}}', '{{if $item.setInfoMargin(LargeImage.width+10)}}{{/if}}', '
    ', linkOpenTag, '${Title}', '', '
    ', '{{/if}}' ].join(''); var imageTemplate = [ '{{if _ShowSmallImage}}',smallImageTemplate,'{{/if}}', '{{if _ShowMediumImage}}',mediumImageTemplate,'{{/if}}', '{{if _ShowLargeImage}}',largeImageTemplate,'{{/if}}' ].join(''); var linkTemplate=linkOpenTag + '${Title}'; var priceContentTemplate = [ '{{if $item.isSale()}}', '' + r.ListPrice + '${ListPrice.FormattedPrice}
    ', '{{if OfferSummary.LowestNewPrice}}' + r.Price + '${OfferSummary.LowestNewPrice.FormattedPrice}{{/if}}', '' + r.PriceUpdatedat + '', '{{else}}', '' + r.Price + '${ListPrice.FormattedPrice}', '' + r.PriceUpdatedat + '', '{{/if}}' ].join(''); var priceTemplate='{{if ListPrice}}
    ' + priceContentTemplate + '
    {{/if}}'; var priceLiTemplate='{{if ListPrice}}
  • ' + priceContentTemplate + '
  • {{/if}}'; var reviewLinkTemplate=''; if(this.isCustomerReviewEnabled){ reviewLinkTemplate='' + r.SeeCustomerReviews + ''; } this.partial={ smallImage:smallImageTemplate, mediumImage:mediumImageTemplate, largeImage:largeImageTemplate, link:linkTemplate, price:priceTemplate }; var defaultTemplates={ Small:[ '
    ', imageTemplate, '{{if _ShowDefaultImage}}',smallImageTemplate,'{{/if}}', '
    ', '

    ',linkTemplate,'

    ', '
      ', '{{if Creator}}
    • ${Creator}
    • {{/if}}', '{{if Manufacturer}}
    • ${Manufacturer}
    • {{/if}}', priceLiTemplate, '{{if PublicationDate}}
    • ' + r.PublicationDate + '${PublicationDate}
    • {{/if}}', '{{if SalesRank}}
    • ' + r.SalesRank + '' + r.SalesRankValue + '
    • {{/if}}', '
    ', '
    ', reviewLinkTemplate, '', '
    ' ], Music:[ '
    ', imageTemplate, '{{if _ShowDefaultImage}}',mediumImageTemplate,'{{/if}}', '
    ', '

    ',linkTemplate,'

    ', '
      ', '{{if Artist}}
    • ${Artist}
    • {{/if}}', '{{if Creator}}
    • ${Creator}
    • {{/if}}', '{{if Label}}
    • ${Label}
    • {{/if}}', priceLiTemplate, '{{if ReleaseDate}}
    • ' + r.ReleaseDate + '${ReleaseDate}
    • {{/if}}', '{{if SalesRank}}
    • ' + r.SalesRank + '' + r.SalesRankValue + '
    • {{/if}}', '{{if RunningTime}}
    • ' + r.RunningTime + '' + r.RunningTimeValue + '
    • {{/if}}', '
    ', '
    ', reviewLinkTemplate, '', '
    ' ], DVD:[ '
    ', imageTemplate, '{{if _ShowDefaultImage}}',mediumImageTemplate,'{{/if}}', '
    ', '

    ',linkTemplate,'

    ', '
      ', '{{if Director}}
    • ${Director}
    • {{/if}}', '{{if Actor}}
    • ${Actor}
    • {{/if}}', '{{if Label}}
    • ${Label}
    • {{/if}}', priceLiTemplate, '{{if ReleaseDate}}
    • ' + r.ReleaseDate + '${ReleaseDate}
    • {{/if}}', '{{if SalesRank}}
    • ' + r.SalesRank + '' + r.SalesRankValue + '
    • {{/if}}', '{{if RunningTime}}
    • ' + r.RunningTime + '' + r.RunningTimeValue + '
    • {{/if}}', '
    ', '
    ', reviewLinkTemplate, '', '
    ' ], Book:[ '
    ', imageTemplate, '{{if _ShowDefaultImage}}',mediumImageTemplate,'{{/if}}', '
    ', '

    ',linkTemplate,'

    ', '
      ', '{{if Author}}
    • ' + r.BookAuthor + '${Author}
    • {{/if}}', priceLiTemplate, '
    • ' + r.BookPublicationDate + '${PublicationDate}
    • ', '{{if SalesRank}}
    • ' + r.SalesRank + '' + r.SalesRankValue + '
    • {{/if}}', '
    • ${Binding}' + r.NumberOfPagesValue + '
    • ', '
    • ISBN-10${ISBN}
    • ', '
    • ISBN-13${EAN}
    • ', '
    • ' + r.BookPublisher + '${Publisher}
    • ', '
    ', '
    ', reviewLinkTemplate, '', '
    ' ], eBooks:[ '
    ', imageTemplate, '{{if _ShowDefaultImage}}',mediumImageTemplate,'{{/if}}', '
    ', '

    ',linkTemplate,'

    ', '
      ', '{{if Author}}
    • ' + r.BookAuthor + '${Author}
    • {{/if}}', priceLiTemplate, '
    • ' + r.BookPublicationDate + '${PublicationDate}
    • ', '{{if SalesRank}}
    • ' + r.SalesRank + '' + r.SalesRankValue + '
    • {{/if}}', '
    • ${Binding}' + r.NumberOfPagesValue + '
    • ', '
    • ' + r.BookPublisher + '${Publisher}
    • ', '
    ', '
    ', reviewLinkTemplate, '', '
    ' ] }; this.template(defaultTemplates); var me=this; $.each(this.addTemplateCallbacks, function (i, callback){ var t=callback.call(me, me.partial); if(t) me.template(t); }); }, addTemplateCallbacks:[], addTemplate:function (fn){ if(typeof(fn)=='function'){ this.addTemplateCallbacks.push(fn); }}, template:function (templates){ $.each(templates, function (name, tmpl){ if(tmpl){ $.template('amazonjs' + name + 'Tpl', (typeof tmpl==='string') ? tmpl:tmpl.join('')); }}); }, render:function (items){ var $items=[]; this.initTemplate(); $(".amazonjs_item").each(function (){ var classNames=$(this).attr('class').split(' '), c=classNames[0].split('_'), asin=c[1], countryCode=c[2], tmpl=(c.length > 3) ? c[3]:null, item=find(asin, countryCode), imgSize=$(this).attr('data-img-size') ; if(item){ item._ImageSize=imgSize||''; var $item=$.amazonjs.tmpl(item, $.amazonjs.formatTmplName(tmpl)); $(this).replaceWith($item.hide()); var $review=$item.find('.amazonjs_review'); if(isIE6){ $item.css('position', 'static'); $review.css({ 'float':'right', 'position':'static', 'marginRight':'32px' }); } $review.click(function (){ tb_show(this.title, this.href); this.blur(); return false; }); if($.amazonjs.isTrackEventEnabled){ $item.find('.amazonjs_link').click(function(){ try { var data=$(this).data(); var title=$(this).attr('title'); if(data.role=='amazonjs_product'){ if($.isFunction(ga)){ ga('send', 'event', 'AmazonJS', 'Click', data.asin + ' ' + title); }else if(_gaq){ _gaq.push(['_trackEvent', 'AmazonJS', 'Click', data.asin + ' ' + title]); }} } catch (e){ }}); } $items.push($item); }else{ tmpl='Link' + countryCode.toUpperCase(); item={ asins:asin, fc1:'000000', lc1:'0000FF', bc1:'000000', bg1:'FFFFFF', IS2:1, lt1:'_blank', f:'ifr', m:'amazon' }; var $item=$.amazonjs.tmpl(item, $.amazonjs.formatTmplName(tmpl)); $(this).replaceWith($item); }}); function find(asin, countryCode){ for (var i=0, length=items.length; i < length; i++){ if(items[i].ASIN==asin&&items[i].CountryCode==countryCode){ return items[i]; }} } if($.amazonjs.isFadeInEnabled){ function fadeIn(){ if($items.length > 0){ var $item=$items.shift(); $item.fadeIn(); setTimeout(fadeIn, 100); }} fadeIn(); }else{ $.each($items, function(){ this.show(); }); }}, formatTmplName:function (key){ return (key) ? 'amazonjs' + key + 'Tpl':null; }, formatNumber:function (val){ val +=''; var x=val.split('.'), x1=x[0], x2=x.length > 1 ? '.' + x[1]:'', rgx=/(\d+)(\d{3})/; while (rgx.test(x1)){ x1=x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; }, formatDateTime:function (timestamp){ var dt=new Date(timestamp * 1000); var Y=dt.getFullYear(), m=dt.getMonth() + 1, d=dt.getDate(), H=dt.getHours(), i=dt.getMinutes(); if(m < 10) m='0' + m; if(d < 10) d='0' + d; if(H < 10) H='0' + H; if(i < 10) i='0' + i; return Y + '/' + m + '/' + d + ' ' + H + ':' + i; }, getTemplate:function (item){ var defaultTmpl=this.formatTmplName('Small'); if(item&&item.ProductGroup){ var tmpl=this.formatTmplName(item.ProductGroup); return $.template[tmpl]||defaultTmpl; } return defaultTmpl; }, prepareData:function (item){ if(isHttpsScheme){ $.each(this.imageAttributes, function(i, v){ var image=item[v]; if(image&&image.src){ image.src=image.src.replace('http://ecx.images-amazon.com', 'https://images-eu.ssl-images-amazon.com'); }}); } item._ShowDefaultImage=_ShowSmallImage=item._ShowMediumImage=item._ShowLargeImage=false; if(item._ImageSize=='small') item._ShowSmallImage=true; else if(item._ImageSize=='medium') item._ShowMediumImage=true; else if(item._ImageSize=='large') item._ShowLargeImage=true; else item._ShowDefaultImage=true; item.PublicationDate=item.PublicationDate||item.ReleaseDate; item.Manufacturer=item.Manufacturer||item.Label; if(item.SalesRank) item.SalesRank=this.formatNumber(item.SalesRank); if(item.PublicationDate) item.PublicationDate=item.PublicationDate.replace(/-/g, '/'); if(item.ReleaseDate) item.ReleaseDate=item.ReleaseDate.replace(/-/g, '/'); if(item.Artist&&item.Creator){ var Creator=[]; var a=$.isArray(item.Artist) ? item.Artist:[item.Artist]; var c=$.isArray(item.Creator) ? item.Creator:[item.Creator]; $.each(c, function (i, value){ if($.inArray(value, a)==-1) Creator.push(value); }); item.Creator=(Creator.length) ? Creator:null; } item.UpdatedDate=this.formatDateTime(item.UpdatedAt); return item; }, tmpl:function (item, tmpl){ item=this.prepareData(item); if(!item.ListPrice&&item.OfferSummary){ item.ListPrice=item.OfferSummary.LowestNewPrice; } return $.tmpl($.template[tmpl]||this.getTemplate(item), item, { isSale:function (){ if(this.data){ var lp=this.data.ListPrice, la=Number(lp.Amount), os=this.data.OfferSummary||{}, sp=os.LowestNewPrice||{}, sa=Number(sp.Amount); return (!isNaN(sa)&&sa < la); } return false; }, setInfoMargin: function(margin){ return this.data._InfoMarginLeft=margin; }}); }, execute: function(){ var amazonjsVars=window.amazonjsVars; if(amazonjsVars){ function render(){ if(!amazonjsVars.items){ return; } if($.amazonjs.isExecuted){ return; } if(amazonjsVars.isCustomerReviewEnabled){ if(typeof tb_pathToImage==='undefined'){ tb_pathToImage=amazonjsVars.thickboxUrl + '/loadingAnimation.gif'; } if(typeof tb_closeImage==='undefined'){ tb_closeImage=amazonjsVars.thickboxUrl + '/tb-close.png'; }} $.amazonjs.isFadeInEnabled=amazonjsVars.isFadeInEnabled; $.amazonjs.isCustomerReviewEnabled=amazonjsVars.isCustomerReviewEnabled; $.amazonjs.isTrackEventEnabled=amazonjsVars.isTrackEventEnabled; $.amazonjs.resource=amazonjsVars.resource; $.amazonjs.template(amazonjsVars.regionTemplate); $.amazonjs.render(amazonjsVars.items); $.amazonjs.isExecuted=true; } if(amazonjsVars.isFadeInEnabled){ setTimeout(function (){ render(); }, 1000); }else{ render(); }} }} }); $(document).ready(function(){ $.amazonjs.execute(); }); $(window).load(function(){ $.amazonjs.execute(); }); if(document.addEventListener){ document.addEventListener('DOMContentLoaded', function (){ $.amazonjs.execute(); }); }})(jQuery);